home *** CD-ROM | disk | FTP | other *** search
/ Amiga News 96 / Amiga News 96.iso / dpat / dpat129 / amighpv2a / docs / amighp2.0a_eng.doc next >
Text File  |  1977-12-31  |  8KB  |  438 lines

  1.  
  2.                            ********************
  3.                            *    AMIGHP V1.0   *
  4.                            * © LEGER Frederic *
  5.                            ********************
  6.                            *                  *
  7.                            *      MANUAL      *
  8.                            *                  *
  9.                            ********************
  10.  
  11.  
  12. 1) The compilation
  13. -----------------
  14.  
  15. run a shell with the following sentence :
  16.  
  17.    AMIGHP   infile   outfile
  18.  
  19. Easy, isn't it ?
  20.  
  21. 2) The compiler stack
  22. ---------------------
  23.  
  24. AMIGHP use a twice level stack, which are in the register
  25. A.A and C.A.
  26. To save this stack you must use the STO instruction.
  27. ex:
  28.    12 I ADD -> C.A
  29.    15 I ADD -> A.A
  30.    ADD      -> C.A = C.A + A.A
  31.    I STO    -> I = C.A , C.A is now empty
  32.  
  33. If you use the stack, you can improve the optimisation of your
  34. output-code.
  35.  
  36. You can for exemple write : 0 I STO I 15 ADD 12 MUL I STO
  37. I will have a value of 180.
  38.  
  39. WARNING : The stack has only a 2 levels height, not 3 or more !
  40.           The compiler will explain you this problem.
  41.  
  42. 3) The  variables
  43. ----------------
  44.  
  45. The temporary storage of those variables is at $800F5h.
  46. So this methode permits having 266.5 good bytes, without any
  47. address computation. ( Let's having SPEEEEED!)
  48. Remember : CHARS are INTEGERS in AMIGHPv1.
  49.  
  50. 4) The instructions
  51. -------------------
  52.  
  53. DEF ...... ENDDEF
  54. -----------------
  55. Variables are defined in a block surrounded by DEF and FINDEF
  56. This block is always on the top of your programs.
  57. you MUST write it even if it is empty.
  58.  
  59. INTEGER
  60. -------
  61. At present time, only integer type is available for variables.
  62. You can use 106 integers at maximum.
  63. An integer has a value between [0,1048575].
  64. An integer is a variable which can be in the A field of C or
  65. any other register.
  66. ex:
  67.    DEF
  68.     I J K INTEGER
  69.    FINDEF
  70.  
  71. CHAR and POINTER
  72. ----------------
  73. You can define CHAR variables or POINTER but they are in fact INTEGERS.
  74.  
  75. INC
  76. ---
  77. Variable ++
  78. ex:
  79.    I INC
  80.  
  81. DEC
  82. ---
  83. Variable --
  84. ex:
  85.    I DEC
  86.  
  87. STO
  88. ---
  89. Stocke a value , a result or a variable in a variable.
  90. ex:
  91.    120 I STO ou J I STO   (stocke dans I)
  92.  
  93. EXIT
  94. ----
  95. Should I explain you ?
  96. ex:
  97.    .... I PUSH EXIT
  98.  
  99. PUSH
  100. ----
  101. Push a variable in the HP48 stack.
  102. ex:
  103.    I PUSH
  104.  
  105. ADD
  106. ---
  107. Addition of two operands , results in C.A or A.A
  108. ex:
  109.    I  J ADD K STO
  110.    I 10 ADD K STO
  111.  
  112. SUB
  113. ---
  114. Subtraction of two operands , results in C.A or A.A
  115. ex:
  116.    I  J SUB K STO
  117.    I 10 SUB K STO
  118.  
  119. MUL
  120. ---
  121. Multiplication of 2 operands , results in C.A or A.A
  122. ex:
  123.    I  J MUL K STO
  124.    I 10 MUL K STO
  125.  
  126. INTOFF
  127. ------
  128. Remove the interruptions.
  129.  
  130. INTON
  131. -----
  132. interruptions are BACK !
  133.  
  134. POP
  135. ---
  136. Read a system binary in the HP48 stack and put it in a variable.
  137. This fonction DROP the SB.
  138. ex:                          --------------
  139.    I POP                    |4)            |
  140. => I = 154A4h               |3)            |
  141.                             |2)            |
  142.                             |1) <154A4h>   |
  143.                             |--------------|
  144.                             |  |  |  |  |  |
  145.                              --------------
  146.  
  147. LOOP
  148. --
  149. Open a LOOP...ENDLOOP
  150.  
  151. ENDLOOP
  152. ----
  153. Close a LOOP...ENDLOOP
  154.  
  155. WHILE
  156. -----
  157. WHILE condition DO instructions ENDWHILE
  158. ex:
  159.    WHILE
  160.      I J <
  161.    DO
  162.      I DEC
  163.    ENDWHILE
  164.  
  165.  
  166. ==,!=,<,>,<=,>=
  167. ---------------
  168. Compare two operands
  169.  
  170. I J <=   is read I <= J
  171. I 10 <=  is read I <= 10
  172.  
  173. IF
  174. --
  175.  
  176. ex:
  177.    IF          IF
  178.     I 50 >      I 50 >
  179.    THEN        THEN
  180.     I DEC       I DEC
  181.    ELSE        ENDIF
  182.      I INC
  183.    ENDIF
  184.  
  185. The ENDIF is always NECESSARY, not IF.
  186.  
  187. INCLUDE
  188. -------
  189. You can use ASM "inline" with this instruction.
  190. ex:
  191.    ROUT1.ASM INCLUDE
  192.  
  193. GETI
  194. ----
  195. Get one integer witch is pointed by D1.
  196. (Get the address of the first object in the HP48 stack
  197. and put it in a variable.)
  198. ex:
  199.    ADR.OBJ GETADR
  200.  
  201. PUTI
  202. ----
  203. Write an integer with help of D1.
  204.  
  205. D1STO
  206. -----
  207. Put a variable or a number into D1.
  208. ex:
  209.  526032 I STO I D1STO  -> BEURK !!!
  210.  526032 D1STO          -> D1=(5) $806D0
  211.  
  212. D1RCL
  213. -----
  214. Save D1 in a variable.
  215. ex:
  216.    15400 I STO I D1STO J PUTC I D1RCL
  217.  
  218. GETC
  219. ----
  220. Get a char pointed by D1 in a variable.
  221. and make D1=D1+2.
  222. ex:
  223.    15400 I STO I D1STO J GETC
  224.  
  225. PUTC
  226. ----
  227. Put a char at the address pointed by D1.
  228. and make D1=D1+2.
  229. ex:
  230.    15400 I STO I D1STO J PUTC
  231.  
  232. GETCAR
  233. ------
  234. Get a char pointed by D1 in a variable.
  235. ex:
  236.    15400 I STO I D1STO J GETCAR
  237.  
  238. PUTCAR
  239. ------
  240. Put a char at the address pointed by D1.
  241. ex:
  242.    15400 I STO I D1STO J PUTCAR
  243.  
  244. DROP
  245. ----
  246. Drop the first level of the HP48 stack.
  247.  
  248. RESSTR
  249. -------
  250. Reserve a string in memory and give a pointer on the content.
  251. IMPORTANT: the twice level of the compiler stack are saved before
  252. and restored ... after, yes!
  253. ex:
  254.    1500 TAILLE.MEM STO
  255.    ADR.BEG SIZE RESSTR
  256.  
  257. WARNING: The address of the content is the address of beginning
  258.          + 10 bytes.
  259.  
  260. STRCALC
  261. --------
  262. Compute a string.
  263. IMPORTANT: the twice level of the compiler stack are saved before
  264. and restored after.
  265. ex:
  266.    ADR.FIN ADR.BEG PUSH_STR
  267.  
  268. PUSHOBJ
  269. --------
  270. Push one object into the HP48 stack.
  271. ex:
  272.    ADR.DEB PUSH_OBJ
  273.  
  274. DISPON
  275. ------
  276. Display ON.
  277.  
  278. DISPOFF
  279. -------
  280. Display OFF.
  281.  
  282. AON
  283. ---
  284. Indicators ON.
  285.  
  286. AOFF
  287. ----
  288. Indicators OFF.
  289.  
  290. BEEP
  291. ----
  292. Oh Oh Oh Pump up the volume !
  293. IMPORTANT: the twice level of the compiler stack are saved before
  294. and restored after.
  295. ex:
  296.    DURATION FREQUENCY BEEP
  297. DURATION is in milliseconds .
  298.  
  299.  
  300. SL
  301. --
  302. multiplicate by 2.
  303. ex:
  304.    I SL
  305.  
  306. SR
  307. --
  308. divide by 2.
  309. ex:
  310.    J SR
  311.  
  312. INCD1
  313. -----
  314. ex:
  315.    12 INCD1  -> D1=D1+  12
  316.  
  317. ERROR
  318. -----
  319. Make an error message and quit.
  320. ex:
  321.    5 ERROR  -> "Error: Memory Clear"
  322.  
  323. GOSUB
  324. -----
  325. Jump to a procedure.
  326. ex:
  327.    BOB GOSUB
  328.  
  329. RETURN
  330. ------
  331. Come back from a procedure.
  332. ex:
  333.    IF I 560 == THEN RETURN ELSE EXIT ENDIF
  334.  
  335. NOT
  336. ---
  337.  
  338. AND
  339. ---
  340.  
  341. OR
  342. --
  343.  
  344. 7) THE PROCEDURES
  345. -----------------
  346. You can show how to declare a procedure in this example:
  347.  
  348. <<
  349.    DEF                Declaration of global variables.
  350.    FINDEF
  351.    DO
  352.     BOB GOSUB       -> GOSUBL  BOB
  353.     EXIT               D0=D0+  5
  354.    LOOP                A=DAT0  A ...
  355.  
  356.    BOB PROC         *
  357.    DEF              |  Declaration of local variables.
  358.    FINDEF           |                 (not really local)
  359.                     |
  360.    ENDPROC          * -> RTN
  361. >>
  362.  
  363. 6) APPENDICES
  364. -------------
  365.  
  366. - AMIGHP has got some (a lot of ?) bugs AAAARGH!
  367.   But the parts of programs I give with, deals we can work with it.
  368.   In my opinion, AMIGHP is a good way to learn assembleur.
  369.   I hope you will enjoy this progs, even if you do not use it,(like me).
  370.   Please, excuse me for my english, because it isn't my native langage.
  371.  
  372. - The software is totally free in the usage.
  373.   BUT REMEMBER THAT YOU USE IT AT YOUR OWN RISK !!!
  374.  
  375. - header for HPASMv3.10e By Vallee Christophe
  376.  
  377.      beginning :      include entries.i
  378.                       con(5)  DOCODE
  379.                       Start   con(5)  End-Start
  380.  
  381.                       ......................
  382.                       ......................
  383.  
  384.      end       :      End
  385.  
  386.  
  387. - The Futur :
  388.   -----------
  389.   + Some new base-address for the variables.
  390.   + A type LONG (64bits).
  391.   + A new PUSHOBJ.
  392.   + Many others fonctions.
  393.   + A GUI with Requesters.
  394.   + MAC and PC Versions.
  395.  
  396. 7) ABOUT
  397. --------
  398.  
  399. Name:        LEGER
  400. FirstName:   Frederic
  401. NickName:    LEDJ
  402. Age :        19
  403. Level:       DEUG TI
  404. University:  Grenoble FRANCE
  405.  
  406. My AMIGA :  un A500+,A530,4Mb 60ns,2Mb CHIP,
  407.              1 Giga AMI ,1 Giga PC and 58Mb MAC.
  408.  
  409. To contact me : MINITEL 3614 BAL NANARD125
  410.  
  411. A special thank you to my friends Vincent ROUKINE (ROOK)
  412. and Vincent VERILHAC (VV Fly is here?) for their helpfull
  413. pieces of advices !!!
  414.                   ___
  415.                   \\\\
  416.                    \\\\
  417.                     \\\\       ONLY AMIGA !!!
  418.                      \\\\      ___
  419.                       \\\\    ////
  420.                        \\\\  ////
  421.                         \\\\////
  422.                          \\\///   LEDJ
  423.                           \\//
  424.                            \/
  425.  
  426.  
  427.     *** DISCLAIMER ***
  428.  
  429.      NO GUARANTEE IS GIVEN NOR IMPLIED THAT THIS PROGRAM IS FIT FOR ANY
  430.      USE. THIS PROGRAM AND THE INFORMATION WITHIN THIS TEXT IS PROVIDED ON
  431.      "AS IS" BASIS. THE ENTIRE RISK AS TO ITS QUALITY AND PERFORMANCE IS
  432.      WITH THE USER. SHOULD THE PROGRAM PROVE DEFECTIVE, THE USER (AND NOT
  433.      THE AUTHOR) ASSUMES THE ENTIRE COST OF ALL NECCESSARY DAMAGES. IN NO
  434.      EVENT WILL THE AUTHOR BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR
  435.      CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT IN THE PROGRAM. THE
  436.      AUTHOR RESERVES THE RIGHT TO MAKE CHANGES TO THE SOFTWARE OR
  437.      DOCUMENTATION WITHOUT NOTICE.
  438.